<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('岗位管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
<!--        <div class="col-sm-12 search-collapse">-->
<!--            <form id="formId">-->
<!--                <div class="select-list">-->
<!--                    <ul>-->
<!--                        <li>-->
<!--                            <label>岗位名称：</label>-->
<!--                            <input type="text" name="postName"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>开始：</label>-->
<!--                            <input type="text" class="time-input" placeholder="请选择招聘开始时间" name="startTime"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>结束时间：</label>-->
<!--                            <input type="text" class="time-input" placeholder="请选择招聘结束时间" name="endTime"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
<!--                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
<!--                        </li>-->
<!--                    </ul>-->
<!--                </div>-->
<!--            </form>-->
<!--        </div>-->
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "wstudy/student";
    var prefixPost = ctx + "wstudy/post";
    $(function() {
        var options = {
            url: prefix + "/list/post",
            modalName: "岗位管理",
            showSearch: false,
            columns: [{
                checkbox: true
            },
                {
                    field: 'postId',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'post.postName',
                    title: '岗位名称'
                },
                {
                    field: 'post.workplace',
                    title: '工作地址'
                },
                {
                    field: 'post.salary',
                    title: '工资'
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function(value, row, index) {
                        if (row.status=='ON'){
                            return "在职"
                        }
                        if (row.status=='OFF'){
                            return "离职"
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];

                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="details(\'' + row.postId + '\')"><i class="fa fa-search"></i>详情</a> ');

                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function details(id) {
        $.modal.openTab("详情",prefixPost+"/details/"+id)
    }
</script>
</body>
</html>